function MyEmit() {
    this.store = {

    };
}
MyEmit.prototype.on = function(eventName, callback) { //$emit(event,data);  $on(event,callback)
    this.store[eventName] = callback;
    //this.store['eat'] = (num)=>{ console.log('我吃了'+ num + '碗饭') } 
}

MyEmit.prototype.emit = function(eventName, num) {
    this.store[eventName](num);
}

var a = new MyEmit();
a.on('eat', function(num) {
    console.log('我吃了' + num + '碗饭')
});

a.emit('eat', '8');
a.emit('eat', '9');
a.emit('eat', '10');
